home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / cuj0593.zip / 1105028A < prev    next >
Text File  |  1993-01-19  |  974b  |  42 lines

  1. // File: invoice.h
  2. // Copyright   Norman Wilde 1993
  3. // Header for classes used in an Invoice
  4. #include <iostream.h>
  5. enum ClientType {RETAIL, WHOLESALE, FOREIGN};
  6. class Item {
  7.   long     prodCode;
  8.   long     quant;
  9.   float    basePrice;
  10.   friend   ostream& operator << (ostream& s, Item& i);
  11.  public:
  12.   Item(long aCode, long aQuant, float aPrice );
  13.   float value();
  14.   long code();
  15. };
  16. class ItemList {
  17.   Item * theItem;
  18.   ItemList *nextItem;
  19.  public:
  20.   ItemList(Item *anItem );
  21.   void addItem(Item *anItem );
  22.   Item * currentItem();
  23.   ItemList * next();
  24.   ~ItemList();
  25. };
  26. class Client {
  27.   ClientType cType;
  28.   friend ostream& operator << (ostream& s, Client& c);
  29.  public:
  30.   Client(ClientType aClientType);
  31.   ClientType type();
  32. };
  33. class Invoice {
  34.   Client   *iClient;
  35.   ItemList *iList;
  36.   friend ostream& operator << (ostream&s, Invoice& i);
  37.  public:
  38.   Invoice(Client *aClient);
  39.   void addItem(Item *anItem);
  40.   float totalDiscount();
  41. };
  42.